package o;

import android.app.Activity;
import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
import com.huawei.appgallery.purchasehistory.ui.activity.PurchaseMenuActivity;
import huawei.widget.HwSubTabWidget;
import java.lang.ref.WeakReference;

public class cti implements OnPageChangeListener {
    private WeakReference<HwSubTabWidget> ˊ;
    private WeakReference<Activity> ˏ;

    public cti(HwSubTabWidget hwSubTabWidget, Activity activity) {
        this.ˊ = new WeakReference(hwSubTabWidget);
        this.ˏ = new WeakReference(activity);
    }

    public void onPageScrolled(int i, float f, int i2) {
        if (this.ˊ != null) {
            HwSubTabWidget hwSubTabWidget = (HwSubTabWidget) this.ˊ.get();
            if (hwSubTabWidget != null) {
                hwSubTabWidget.setSubTabScrollingOffsets(i, f);
            }
        }
    }

    public void onPageScrollStateChanged(int i) {
        if (this.ˊ != null) {
            HwSubTabWidget hwSubTabWidget = (HwSubTabWidget) this.ˊ.get();
            if (hwSubTabWidget != null) {
                hwSubTabWidget.setSubTabSelected(i);
            }
        }
        if (this.ˏ != null) {
            Activity activity = (Activity) this.ˏ.get();
            if (activity instanceof PurchaseMenuActivity) {
                ((PurchaseMenuActivity) activity).ˎ(i);
            }
        }
    }

    public void onPageScrolled(int i) {
    }
}
